<template>
  <div class="hn">
    <van-sticky :offset-top="0">
      <van-nav-bar
        @click-left="onClickLeft"
        @click-right="onClickRight"
      >
        <template #left>
          <van-icon name="wap-nav" color="black"/>
          <!-- 侧边导航栏 -->
          <van-popup
          v-model="show"
          position="left"
          :style="{height: '100%' }"
          get-container="#app">
            <van-sidebar v-model="activeKey">
              <van-sidebar-item title="标签名称" />
              <van-sidebar-item title="标签名称" />
              <van-sidebar-item title="标签名称" />
            </van-sidebar>
          </van-popup>
        </template>
        <template #title>
          <van-search class="vs"
            v-model="value"
            shape="round"
            placeholder="请输入搜索关键词"
            input-align="center"
          ></van-search>
        </template>
        <template #right>
          <van-icon name="manager" color="black"/>
        </template>
      </van-nav-bar>
    </van-sticky>
  </div>
</template>

<script>
import { Toast } from 'vant';

  export default {
    data(){
      return{
        value:'',
        show: false,
        activeKey: 0,
      }
    },
    methods: {
      onClickLeft() {
        this.show = true;
      },
      onClickRight() {
        if(this.$store.state.us != -1){
          this.$router.push('/own')
        }else{
          this.$router.push('/login')
        }
      }
    },
  };
</script>

<style>
  .vs{
    padding: 0 !important;
  }
</style>
